<script src="<?php print $url?>js/jquery.ui.datepicker.js"></script>
<script src="<?php print $url?>js/jquery.ui.core.js"></script>
<script src="<?php print $url?>js/jquery.ui.autocomplete.js"></script>
<script src="<?php print $url?>js/jquery.price_format.1.8.min.js"></script>
<div id="main-content">
  <div class="container-fluid">
    <ul class="breadcrumb">
      <li><a href="<?php print site_url("frm/accounting/journal")?>"><?php print lang('frm_journal')?></a><span class="divider">»</span></li>
      <li><a href="<?php print site_url("frm/accounting/journal-log/".$id_frm_journal)?>"><?php print lang('frm_journal_transaksi')?></a><span class="divider">»</span></li>
      <li class="active"><?php print $title?></li>
    </ul>
    <div class="row-fluid">
			<div class="span12 ">
				<div class="widget-block">
          <?php
          if($status == '2'){
          ?>
          <div class="alert alert-error fade in">
            <button data-dismiss="alert" class="close" type="button">×</button>
            <strong><?php print urldecode($pesan)?></strong>
          </div>
          <?php
          }
          if($status == '1'){
          ?>
          <div class="alert alert-success fade in">
            <button data-dismiss="alert" class="close" type="button">×</button>
            <strong><?php print urldecode($pesan)?></strong>
          </div>
          <?php
          }
          ?>
					<div class="widget-head">
						<h5><?php print $title?></h5>
					</div>
					<div class="widget-content">
						<div class="widget-box">
							<?php print $this->form_eksternal->form_open_multipart("", 'class="form-horizontal well"', array("id_detail" =>  $data[0]->id_frm_journal_log))?>
									<!--<legend>User Form</legend>-->
                  <fieldset>
										<div class="control-group">
											<label class="control-label">Tanggal</label>
											<div class="controls">
                        <?php 
                        if(!$data[0]->tanggal)
                          $data[0]->tanggal = date("Y-m-d");
                        
                        print $this->form_eksternal->form_date("tanggal", $data[0]->tanggal, "tanggal")?>
											</div>
										</div>
                    <div class="control-group">
											<label class="control-label">No Transaksi</label>
											<div class="controls">
                        <?php print $this->form_eksternal->form_input('notransaksi', $data[0]->notransaksi, 'class="input-xlarge"')?>
											</div>
										</div>
										<div class="control-group">
											<label class="control-label"><b>Debit</b></label>
											<div class="controls">
                        <?php print $this->form_eksternal->form_addrow_autocomplate_input("debit_account[]", "debit_price[]", "da[]", "da_1", 
                        site_url("frm/accounting/addrow-account/debit_account/da/debit_price/debit"), "debit_table", "add_debit", "debit_nomor", 
                        $tr['debit'], "debit", site_url("frm/accounting/auto-account"), $string['debit'], $price_value['debit'], $value_id['debit'], 
                        "", $delete = true, "debit_update[]", $id_update['debit'])?>
											</div>
										</div>
										<div class="control-group">
											<label class="control-label"><b>Kredit</b></label>
											<div class="controls">
                        <?php print $this->form_eksternal->form_addrow_autocomplate_input("kredit_account[]", "kredit_price[]", "ka[]", "ka_1", 
                        site_url("frm/accounting/addrow-account/kredit_account/ka/kredit_price/kredit"), "kredit_table", "add_kredit", "kredit_nomor", 
                        $tr['kredit'], "kredit", site_url("frm/accounting/auto-account"), $string['kredit'], $price_value['kredit'], 
                        $value_id['kredit'], $extra = "", $delete = true, "kredit_update[]", $id_update['kredit'])?>
											</div>
										</div>
                    <div class="control-group">
											<label class="control-label">Note</label>
											<div class="controls">
                        <?php print $this->form_eksternal->form_textarea('note', $data[0]->note, 'class="input-xlarge" rows="3"')?>
											</div>
										</div>
									</fieldset>
								<div class="form-actions">
									<button type="submit" class="btn btn-info">Save changes</button>
                  <a href="<?php print site_url("frm/accounting/journal-log/".$id_frm_journal)?>" class="btn btn-warning" >Cancel</a>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
    </div>
  </div>
</div>
<script>
  function add_row_tambahan(table,url,act,param){
    var no = parseInt($('#'+param).val());
    $('#'+param).val(no+1);
    $.post(url,{no:$('#'+param).val(),action:act},function(data){
        $(data).clone(true).insertBefore("#"+table+" #"+act);
    });
  }
  function del_row_tambahan(tr){
    $("#"+tr).remove();
  }
</script>